package com.youyi.yychosesdk.models.album.entity;

import android.net.Uri;
import android.os.Parcel;
import android.os.Parcelable;
import android.util.Log;

public class Photo implements Parcelable {
    public static final Creator<Photo> CREATOR = new Creator<Photo>() {
        /* class com.youyi.yychosesdk.models.album.entity.Photo.AnonymousClass1 */

        @Override // android.os.Parcelable.Creator
        public Photo createFromParcel(Parcel parcel) {
            return new Photo(parcel);
        }

        @Override // android.os.Parcelable.Creator
        public Photo[] newArray(int i) {
            return new Photo[i];
        }
    };
    private static final String TAG = "Photo";
    public long duration;
    public int height;
    public String name;
    public int orientation;
    public String path;
    public boolean selected;
    public boolean selectedOriginal;
    public long size;
    public long time;
    public String type;
    public Uri uri;
    public int width;

    public int describeContents() {
        return 0;
    }

    public Photo(String str, Uri uri2, String str2, long j, int i, int i2, int i3, long j2, long j3, String str3) {
        this.name = str;
        this.uri = uri2;
        this.path = str2;
        this.time = j;
        this.width = i;
        this.height = i2;
        this.orientation = i3;
        this.type = str3;
        this.size = j2;
        this.duration = j3;
        this.selected = false;
        this.selectedOriginal = false;
    }

    public boolean equals(Object obj) {
        try {
            return this.path.equalsIgnoreCase(((Photo) obj).path);
        } catch (ClassCastException e) {
            Log.e(TAG, "equals: " + Log.getStackTraceString(e));
            return super.equals(obj);
        }
    }

    public String toString() {
        return "Photo{name='" + this.name + '\'' + ", uri='" + this.uri.toString() + '\'' + ", path='" + this.path + '\'' + ", time=" + this.time + '\'' + ", minWidth=" + this.width + '\'' + ", minHeight=" + this.height + ", orientation=" + this.orientation + '}';
    }

    public void writeToParcel(Parcel parcel, int i) {
        parcel.writeParcelable(this.uri, i);
        parcel.writeString(this.name);
        parcel.writeString(this.path);
        parcel.writeString(this.type);
        parcel.writeInt(this.width);
        parcel.writeInt(this.height);
        parcel.writeInt(this.orientation);
        parcel.writeLong(this.size);
        parcel.writeLong(this.duration);
        parcel.writeLong(this.time);
        parcel.writeByte(this.selected ? (byte) 1 : 0);
        parcel.writeByte(this.selectedOriginal ? (byte) 1 : 0);
    }

    protected Photo(Parcel parcel) {
        this.uri = (Uri) parcel.readParcelable(Uri.class.getClassLoader());
        this.name = parcel.readString();
        this.path = parcel.readString();
        this.type = parcel.readString();
        this.width = parcel.readInt();
        this.height = parcel.readInt();
        this.orientation = parcel.readInt();
        this.size = parcel.readLong();
        this.duration = parcel.readLong();
        this.time = parcel.readLong();
        boolean z = true;
        this.selected = parcel.readByte() != 0;
        this.selectedOriginal = parcel.readByte() == 0 ? false : z;
    }
}
